package com.itheima.anno;

import com.itheima.validation.StateValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
import java.util.List;

@Documented//元注解
@Constraint(validatedBy = {StateValidation.class})//指定提供校验规则的类
@Target({ ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)


public @interface State {

    //提供校验失败后的信息
    String message() default "State的值只能是已发布或者草稿";

    //指定分组
    Class<?>[] groups() default {};

    //负载
    Class<? extends Payload>[] payload() default {};

}
